|
|
|
|
|
|
|
Consider the example of order processing. For each item a person orders, you need the item's number, description, price, order number, and order date, as well as the customer's name, address, and phone number. If you place all this information in one table, the result looks like the table shown in Figure 24.3. |
|
|
|
|
|
|
|
|
Figure 24.3
Nonnormalized data produces a large, inefficient data table. |
|
|
|
|
|
|
|
|
As you can see, much of the data in the table is repeated. This repetition introduces two problems. The first problem is wasted space, because you repeat information. The second problem is one of data accuracy or currency. If, for example, a customer changes his or her phone number, you have to change it for all the records that apply to that customerwith the possibility that you will miss one of the entries. In the table in Figure 24.3, notice that Martha Smith's phone number was changed in the latest entry but not in the two earlier entries. If an employee looks up Martha Smith and uses an earlier entry, that employee would not find Martha's updated phone number. |
|
|
|
|
|
|
|
|
A better solution for handling the data is to put the customer information in one table and the sales order information in another table. You can assign each customer a unique ID and include that ID in the sales order table to identify the customer. This arrangement yields two tables with the data structure shown in Figure 24.4. |
|
|
|
|
|
|
|
|
With this type of arrangement, the customer information appears in only one place. Now, if a customer changes his or her phone number, you have to change only one record. |
|
|
|
|
|
|
|
|
You can do the same thing to the items sold and order information. This leads to the development of four tables, but the organization of the tables is much more efficient. You can be sure that when information must be changed, it will change in only one place. This arrangement is shown in Figure 24.5. With the four-table arrangement, the Orders table and the Items Ordered table provide the links between the customers and the retail items they purchased. The Items Ordered table contains one record for each item of a given order. The Orders table relates the items to the date of purchase and the customer making the purchase. |
|
|
|
|
|